# Contributor: Bjoern Schilberg <bjoern@intevation.de>
# Maintainer: Bjoern Schilberg <bjoern@intevation.de>
pkgname=mapserver
pkgver=7.4.4
pkgrel=2
pkgdesc="CGI-based platform for publishing spatial data and interactive mapping applications to the web"
url="https://mapserver.org/"
arch="x86_64"
license="MIT"
depends_dev="
	cmake
	postgresql-dev
	geos-dev
	gdal-dev
	jpeg-dev
	giflib-dev
	libxml2-dev
	proj-dev
	fcgi-dev
	curl-dev
	freetype-dev
	cairo-dev
	protobuf-c-dev
	"
makedepends="
	$depends_dev
	"
subpackages="
	$pkgname-dev
	"
source="
	http://download.osgeo.org/mapserver/$pkgname-$pkgver.tar.gz
	"

build() {
	mkdir build; cd build
	cmake .. \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=None \
		-DWITH_GDAL=ON \
		-DWITH_GEOS=ON \
		-DWITH_OGR=ON \
		-DWITH_PROJ=ON \
		-DWITH_POSTGIS=ON \
		-DWITH_KML=ON \
		-DWITH_WCS=ON \
		-DWITH_SOS=ON \
		-DWITH_WMS=ON \
		-DWITH_CLIENT_WMS=ON \
		-DWITH_WFS=ON \
		-DWITH_CLIENT_WFS=ON \
		-DWITH_THREAD_SAFETY=OFF \
		-DWITH_FCGI=ON \
		-DWITH_CAIRO=ON \
		-DWITH_CURL=ON \
		-DWITH_MYSQL=OFF \
		-DWITH_FRIBIDI=OFF \
		-DWITH_HARFBUZZ=OFF \
		-DWITH_EXEMPI=OFF \
		-DWITH_PROTOBUFC=ON
	make -j1
}

package() {
	cd "$builddir"/build
	make DESTDIR="$pkgdir" install
	rm -rf "$pkgdir"/usr/share/
	chmod -x "$pkgdir"/usr/include/mapserver/*.h
}

sha512sums="6885780edd005ea2907e7cd20e435fc33e9642a106663ee5f5d601f32b0fd9ad18e21f17d33cc652865b4728db6394b567a35714bacd9a9aa340394726635bca  mapserver-7.4.4.tar.gz"
